import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/teachers/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/teachers/infor/getInfor',
    method: 'get',
    params: { token }
  })
}

export function showInfor(token) {
  return request({
    url: '/teachers/infor/showInfor',
    method: 'get',
    params: { token }
  })
}
export function logout() {
  return request({
    url: '/teachers/logout',
    method: 'post'
  })
}

export function updateInfor(data) {
  return request({
    url: '/teachers/infor/updateInfor',
    method: 'post',
    data
  })
}


export function updatePwd(data) {
  return request({
    url: '/teachers/infor/updatePwd',
    method: 'post',
    data
  })
}



export function showFile(token) {
  return request({
    url: '/teachers/file/showFile',
    method: 'get',
    params:{token}
  })
}

export function beforCorrectFile(f_id) {
  return request({
    url: '/teachers/file/beforCorrectFile',
    method: 'get',
    params:{
      'f_id':f_id
    }
  })
}

export function correctFile(data) {
  return request({
    url: '/teachers/file/correctFile',
    method: 'post',
    data
  })
}



export function showTLogInfor(token) {
  return request({
    url: '/teachers/showLogInfor',
    method: 'get',
    params: { token }
  })
}

export function sendMsg(data) {
  return request({
    url: '/teachers/sendMsg',
    method: 'post',
    data
  })
}

export function showSendMsg(token) {
  return request({
    url: '/teachers/showSendMsg',
    method: 'get',
    params:{token}
  })
}

export function showReciveMsg(token) {
  return request({
    url: '/teachers/showReciveMsg',
    method: 'get',
    params:{token}
  })
}

export function reply(data) {
  return request({
    url: '/teachers/reply',
    method: 'post',
    data
  })
}

export function downloadFile(url) {
  return request({
    url: url,
    method: 'get',
    
  })
}